<script setup>
	import { onMounted, ref } from 'vue'
	import { onLoad, onShow } from '@dcloudio/uni-app'
	import { http } from '@/utils/http.js'

	const status = ref()
	async function merchantSettleIn() {
		const res = await http.request({
			url: '/api/shop/myApply',
			method: 'POST',
			data: {},
		})
		console.log(res)
		if (res.st == 1) {
			status.value = res.data.status
		}
	}

	//返回我的页面
	function goMinePage() {
		uni.switchTab({
			url: '/pages/mine/index',
		})
	}

	//重新申请
	function reSettleIn() {
		uni.navigateTo({
			url: `/minePage/settlein/index`,
		})
	}
	onShow(() => {
		merchantSettleIn()
	})
</script>

<template>
	<view class="settlestatus-content">
		<image
			v-if="status == 1"
			src="https://ojqn.wm2177.com/wechat_imgs/kapai-test/mine/settlein-status.png"
			style="width: 381rpx; height: 323rpx"
			mode=""
		></image>
		<image
			v-else
			src="https://ojqn.wm2177.com/wechat_imgs/kapai-test/mine/refuse-settlein.png"
			style="width: 481rpx; height: 454rpx"
			mode=""
		></image>
		<view class="" v-if="status == 1">
			<view
				class=""
				style="
					margin-top: 67rpx;
					margin-bottom: 20rpx;
					font-size: 44rpx;
					text-align: center;
				"
			>
				资料正在审核中
			</view>
			<view
				class=""
				style="font-size: 30rpx; color: rgba(166, 166, 166, 1)"
			>
				相关人员将在<text style="color: rgba(132, 83, 237, 1)"
					>3个工作日</text
				>内处理，请耐心等待
			</view>
		</view>

		<view class="" style="font-size: 44rpx; text-align: center" v-else>
			您的申请已被驳回
		</view>

		<view class="button" v-if="status == 1" @click="goMinePage"> </view>
		<view class="button rebutton" v-else @click="reSettleIn"> </view>
	</view>
</template>

<style lang="scss" scoped>
	.settlestatus-content {
		position: relative;
		height: 100vh;
		padding-top: 301rpx;
		box-sizing: border-box;
		display: flex;
		flex-direction: column;
		align-items: center;
		.button {
			position: absolute;
			bottom: 42rpx;
			width: 556rpx;
			height: 106rpx;
			background: url(https://ojqn.wm2177.com/wechat_imgs/kapai-test/mine/settlein-back.png)
				no-repeat;
			background-size: 100% 100%;
		}
		.rebutton {
			background: url(https://ojqn.wm2177.com/wechat_imgs/kapai-test/mine/resettlein.png)
				no-repeat !important;
			background-size: 100% 100% !important;
		}
	}
</style>
